{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import rabbitpy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "connection = rabbitpy.Connection()\n",
    "try:\n",
    "    with connection.channel() as channel:\n",
    "        arguments = {'x-ha-policy': 'nodes',\n",
    "                     'x-ha-nodes': ['rabbit@node1',\n",
    "                                    'rabbit@node2',\n",
    "                                    'rabbit@node3']}\n",
    "        queue = rabbitpy.Queue(channel,\n",
    "                               'my-2nd-ha-queue',               \n",
    "                               arguments=arguments)\n",
    "        if queue.declare():\n",
    "            print('Queue declared')\n",
    "except rabbitpy.exceptions.RemoteClosedChannelException as error:\n",
    "    print('Queue declare failed: %s' % error)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
